// global_config.hpp
#ifndef GLOBAL_CONFIG_HPP
#define GLOBAL_CONFIG_HPP

#include "ap_int.h" // 包含 ap_uint 定义，因为宏中使用了 ap_uint

// General parameters
#define MAX_X_RES 1280
#define MAX_Y_RES 720
#define MAX_TRIANGLES 2000 // Testbench will use 5 triangles, but this defines max capacity

// Tile parameters for screen tiling
#define TILE_WIDTH 64
#define TILE_HEIGHT 64

// Calculate number of tiles
#define NUM_TILES_X ((MAX_X_RES + TILE_WIDTH - 1) / TILE_WIDTH)
#define NUM_TILES_Y ((MAX_Y_RES + TILE_HEIGHT - 1) / TILE_HEIGHT)
#define TOTAL_TILES (NUM_TILES_X * NUM_TILES_Y)

// Maximum fragments for a single tile. This is an upper bound.
// A full tile could be TILE_WIDTH * TILE_HEIGHT. We double it for safety/overlap.
// This is the critical stream depth value.
#define MAX_FRAGMENTS_PER_TILE (TILE_WIDTH * TILE_HEIGHT * 2) // e.g., 64*64*2 = 8192

#endif // GLOBAL_CONFIG_HPP
